package com.block.test.service;


import com.alibaba.fastjson.JSONObject;
import com.block.common.bean.SessionBean;
import com.block.common.model.vo.ResultInfoVO;
import com.block.common.vo.ResponseVo;

import javax.servlet.http.HttpServletRequest;

/**
 * 请求数据合法性校验的父类 (网关)
 */
public abstract class IValidateService {
    /**
     *
     * @param jsonObject
     * @return 返回错误码和错误信息 返回null表示 通过
     */
    public ResponseVo handleProcess(HttpServletRequest request, JSONObject jsonObject, SessionBean sessionBean){
        Object object = request.getAttribute("tranDataBean");
        return validate(object, jsonObject, sessionBean);
    }

    public ResultInfoVO handleProcess2(HttpServletRequest request, JSONObject jsonObject){
        Object object = request.getAttribute("tranDataBean");
        return validate2(object, jsonObject);
    }

    public abstract ResponseVo validate(Object object, JSONObject jsonObject, SessionBean sessionBean);

    public abstract ResultInfoVO validate2(Object object, JSONObject jsonObject);


}
